Previous Book Contents Book Index Next

Inside Macintosh: Open Transport /
Chapter 8 - TCP/IP Services / TCP/IP Services Reference
Options


TCP Options

You can use the options in this section with a protocol level of INET_TCP. These TCP options are not association-related. They may be negotiated in all endpoint states except T_UNBND and T_UNINIT. They are read-only in state T_UNBND.

#define TCP_NODELAY                 0x01  /* set TCP delay mode */
#define TCP_MAXSEG                  0x02  /* read max segment size */
#define TCP__NOTIFY_THRESHOLD       0x10  /* reserved */
#define TCP_ABORT_THRESHOLD         0x11  /* reserved */
#define TCP__CONN_NOTIFY_THRESHOLD  0x12  /* reserved */
#define TCP_CONN_ABORT_THRESHOLD    0x13  /* reserved */
#define TCP_OOBINLINE               0x14  /* reserved */
#define TCP_URGENT_PTR_TYPE         0x15  /* reserved */
#define TCP_KEEPALIVE         OPT_KEEPALIVE/* activate keep-alive timer */
};
Option descriptions

TCP_NODELAY
Set the TCP delay mode. By default, when TCP has a full segment's worth of data, it sends the segment immediately; but if it receives less than a segment's worth of data and has not yet received acknowledgment for the last packet sent, it saves the data until it either receives a full segment's worth, it receives acknowledgment for the last packet, or until a timeout period has expired. (In this context, a full segment is the maximum-sized unit of data that can be sent by TCP at one time and a packet is data that is transmitted as a single unit. ) Specify T_YES for this option to cause all data to be sent immediately. Specify T_NO to return TCP to the default delay mode. A request to set this option to no delay is an absolute requirement.
TCP_MAXSEG
Read the maximum TCP segment size. The maximum segment size is returned as an unsigned long specifying the number of octets. This option is read-only.
TCP_NOTIFY_THRESHOLD
Reserved.
TCP_ABORT_THRESHOLD
Reserved.
TCP_CONN_NOTIFY_THRESHOLD
Reserved.
TCP_CONN_ABORT_THRESHOLD
Reserved.
TCP_OOBINLINE
Reserved.
TCP_URGENT_PTR_TYPE
Reserved.
TCP_KEEPALIVE
Activate the keep-alive timer. If this option is set on, TCP monitors idle connections and sends a keep-alive packet to check a connection after a preset time has expired. You use a t_kpalive structure, described later in this section, to specify the value of this option. The default state for the keep-alive timer is off. A request to activate or deactivate the keep-alive timer is an absolute requirement.
The TCP_KEEPALIVE option uses a t_kpalive structure, defined as follows:

struct t_kpalive {
   long  kp_onoff;   /* option on/off */
   long  kp_timeout; /* timeout in minutes */
};
Field Description
kp_onoff
Activate or deactivate the keep-alive timer. Set this field to T_YES to activate the timer or to T_NO to deactivate it. A request to activate or deactivate the timer is an absolute requirement. The default value of this field is T_NO. The Open Transport TCP implementation does not support the value T_YES|T_GARBAGE for this field.
kp_timeout
Set the requested timeout value, in minutes. Specify a value of T_UNSPEC to use the default value. You may specify any positive value for this field of 120 minutes or greater. The timeout value is not an absolute requirement; if you specify a value less than 120 minutes, TCP will renegotiate a timeout of 120 minutes.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 AUG 1996